<template>
	<view>
		<view class="cu-modal nobg" :class="modalName=='Image'?'show':''">
			<view class="cu-dialog nobg text-center" style="width: 70%;" v-if="config">
				<view class="bg-white shadow">
					<image :src="img_url" mode="widthFix" v-if="img_url" class="w100"></image>
					<image :src="config.service.logo" mode="widthFix" v-else="config.service.logo" class="w100"></image>
					
					<view class="padding-sm ">
						<view v-if="config.service.mobile">联系电话：<text class="text-blue" @tap="makePhoneCall(config.service.mobile)">{{config.service.mobile}}</text></view>
						<view v-if="config.service.qq" class="margin-top-sm"><text>QQ：{{config.service.qq}}</text><text @tap="paste(config.service.qq)" class="cu-btn line-blue sm round margin-left">复制</text></view>
					</view>
				</view>
				<view class="text-center">
					<view class="cu-btn blackbg1 sm text-black cuIcon-close round text-white lg margin-top" @tap="modalName=''"></view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		props: {},
		created: function(e) {
			this.$common.getConfig().then((config) => {
				this.config = config
			})
		},
		data() {
			return {
				modalName: '',
				config: null,
				img_url:''
			}
		},
		methods: {
			show() {
				this.modalName = 'Image'
			},
			paste(value) {
				let _this = this
				uni.setClipboardData({
					data: value,
					success() {
						_this.$common.showSuccess('复制成功')
					}
				})
			},
			makePhoneCall(value){
				uni.makePhoneCall({
				    phoneNumber: value
				});

			}
		},
	}
</script>

<style>
	.nobg {
		background: none;
	}
</style>
